/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.warehouse;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ciummo
 */
@Entity
@Table(name = "Articolo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Articolo.findAll", query = "SELECT a FROM Articolo a"),
    @NamedQuery(name = "Articolo.findByCodArticolo", query = "SELECT a FROM Articolo a WHERE a.codArticolo = :codArticolo"),
    @NamedQuery(name = "Articolo.findByNome", query = "SELECT a FROM Articolo a WHERE a.nome = :nome"),
    @NamedQuery(name = "Articolo.findByTipo", query = "SELECT a FROM Articolo a WHERE a.tipo = :tipo"),
    @NamedQuery(name = "Articolo.findByPrezzo", query = "SELECT a FROM Articolo a WHERE a.prezzo = :prezzo"),
    @NamedQuery(name = "Articolo.findByNote", query = "SELECT a FROM Articolo a WHERE a.note = :note")})
public class Articolo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "codArticolo")
    private String codArticolo;
    @Column(name = "nome")
    private String nome;
    @Column(name = "tipo")
    private String tipo;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "prezzo")
    private Double prezzo;
    @Column(name = "note")
    private String note;

    public Articolo() {
    }

    public Articolo(String codArticolo) {
        this.codArticolo = codArticolo;
    }

    public String getCodArticolo() {
        return codArticolo;
    }

    public void setCodArticolo(String codArticolo) {
        this.codArticolo = codArticolo;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public Double getPrezzo() {
        return prezzo;
    }

    public void setPrezzo(Double prezzo) {
        this.prezzo = prezzo;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codArticolo != null ? codArticolo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Articolo)) {
            return false;
        }
        Articolo other = (Articolo) object;
        if ((this.codArticolo == null && other.codArticolo != null) || (this.codArticolo != null && !this.codArticolo.equals(other.codArticolo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ejb.warehouse.Articolo[ codArticolo=" + codArticolo + " ]";
    }
    
}
